home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / OLEDOC.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  112 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1994, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.5  $
  6. //
  7. //----------------------------------------------------------------------------
  8. #if !defined(OWL_OLEDOC_H)
  9. #define OWL_OLEDOC_H
  10.  
  11. #if !defined(OWL_STGDOC_H)
  12. # include <owl/stgdoc.h>
  13. #endif
  14. #if !defined(OWL_OCFEVENT_H)
  15. # include <owl/ocfevent.h>
  16. #endif
  17. #if !defined(OCF_OCDOC_H)
  18. # include <ocf/ocdoc.h>
  19. #endif
  20.  
  21. #if defined(BI_NAMESPACE)
  22. namespace OWL {
  23. #endif
  24.  
  25. // Generic definitions/compiler options (eg. alignment) preceeding the 
  26. // definition of classes
  27. #include <services/preclass.h>
  28.  
  29. class _OWLCLASS TOleWindow;
  30.  
  31. //
  32. // class TOleDocument
  33. // ~~~~~ ~~~~~~~~~~~~
  34. // The ole document class.
  35. //
  36. class _USERCLASS TOleDocument : public TStorageDocument {
  37.   public:
  38.     TOleDocument(TDocument* parent = 0);
  39.    ~TOleDocument();
  40.  
  41.     // Accessors
  42.     //
  43.     void          SetOcDoc(TOcDocument* doc);
  44.     TOcDocument*  GetOcDoc();
  45.     TOcApp*       GetOcApp();
  46.  
  47.     // Overridables:
  48.     //   TDocument:
  49.     //
  50.     bool          Commit(bool force);
  51.     bool          Open(int mode, const char far* path = 0);
  52.     bool          Close();
  53.     bool          InitDoc();
  54.     bool          CanClose();
  55.     bool          Revert(bool clear);
  56.  
  57.     //   TStorageDocument:
  58.     bool          SetStorage(IStorage* stg, bool remember = true);
  59.     bool          RestoreStorage();
  60.     bool          ReleaseDoc();
  61.  
  62.     //   TOleDocument:
  63.     virtual void  PreOpen();
  64.     virtual bool  Read();
  65.     virtual bool  Write();
  66.     virtual bool  CommitSelection(TOleWindow& oleWin, void* userData);
  67.  
  68.     // Utilities
  69.     //
  70.     bool PathChanged();
  71.     void OleViewClose();
  72.  
  73.   private:
  74.     TOcDocument*      OcDoc;    // OCF document partner
  75.     bool              Closing;  // shutdown in progress
  76. };
  77.  
  78. // Generic definitions/compiler options (eg. alignment) following the 
  79. // definition of classes
  80. #include <services/posclass.h>
  81.  
  82. #if defined(BI_NAMESPACE)
  83. } // namespace OWL
  84. #endif
  85.  
  86. //----------------------------------------------------------------------------
  87. // Inline implementations
  88. //
  89.  
  90. //
  91. inline void TOleDocument::SetOcDoc(TOcDocument* doc)
  92. {
  93.   OcDoc = doc;
  94. }
  95.  
  96. //
  97. inline TOcDocument* TOleDocument::GetOcDoc()
  98. {
  99.   return OcDoc;
  100. }
  101.  
  102. //
  103. // Virtual function to be overriden in TOleDocument-derived class which
  104. // serve or support linking to portions of a document's data.
  105. //
  106. inline bool TOleDocument::CommitSelection(TOleWindow& oleWin, void* userData)
  107. {
  108.   return true;
  109. }
  110.  
  111. #endif
  112.